﻿using System;
using System.ComponentModel.DataAnnotations;
using iHouse.Resource;
using System.ComponentModel.DataAnnotations.Schema;

namespace iHouse.Model.Data
{
    [MetadataType(typeof(Note_Validation))]
    [Table("Note")]
    public class Note
    {
        public int ID { get; set; }
        public string Title { get; set; }
        public string Description { get; set; }
        public Nullable<System.DateTime> CreatedDate { get; set; }
        public string Reference { get; set; }
        public int CategoryID { get; set; }

        public virtual Category Category { get; set; }
    }

    public class Note_Validation
    {
        [Required(ErrorMessageResourceType = typeof(Resources), ErrorMessageResourceName = "NoteTitleRequired")]
        [StringLength(200)]
        public string Title { get; set; }

        [DataType(DataType.DateTime)]
        [Required(ErrorMessageResourceType = typeof(Resources), ErrorMessageResourceName = "NoteCreatedateRequired")]
        public DateTime CreatedDate { get; set; }
    }
}
